// Created by YE on 2024/2/13.
//

#ifndef MATINTERPRETER_YCH_STRING_H
#define MATINTERPRETER_YCH_STRING_H

#include "string.h"
#include "stdlib.h"

#define INITIAL_CAPACITY 8

typedef struct YString {
    char *data;
    size_t length;
    size_t capacity;
} YString;

void initString(YString *string);

void copyString(YString *string, const char *copied);

void copyYString(YString *string, YString *copied);

void cutString(YString *string, const char *cut, size_t pos, size_t length);

void appendString(YString *string, const char *append);

void appendChar(YString *string, char append);

void appendYString(YString *string, YString *append);

void freeYString(YString *string);

void deleteYString(YString *string);

int compareYString(YString *string1, YString *string2);

#endif //MATINTERPRETER_YCH_STRING_H
